<%@ page language="java"
	import="java.util.*,com.tjsinfo.tjsoa.reminded.vo.TSystemReminded,com.tjsinfo.tjsoa.common.*"
	pageEncoding="UTF-8"%>
<%
    request.setAttribute("decorator", "none");
    response.setHeader("Cache-Control","no-cache"); //HTTP 1.1
    response.setHeader("Pragma","no-cache"); //HTTP 1.0
    response.setDateHeader ("Expires", 0); //prevents caching at the proxy server
%>	
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	List<TSystemReminded> list = (List) request.getAttribute("list");
    DealString ds=new DealString();
%>
<%
	int intPage;
	int intPageSize =12;//一页显示的行数
	int intPageCount;//总页数
	int intRowCount;//总行数
	String strPage;
	intRowCount = list.size();
	intPageCount = (intRowCount + intPageSize - 1) / intPageSize;
	strPage = request.getParameter("page");
	if (strPage == null) {//表明在QueryString中没有page这一个参数，此时显示第一页数据 
		intPage = 1;
	} else {//将字符串转换成整型 
		intPage = Integer.parseInt(strPage);
		if (intPage < 1)intPage = 1;
	}
	if (intPage > intPageCount)intPage = intPageCount;
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
		<title>天津市粮油集团有限公司 OA办公自动化协作平台</title>
		<link href="<%=basePath%>style/css.css" rel="stylesheet" type="text/css" />
		<script type='text/javascript' src='<%=basePath%>reminded/js/time.js'></script>
		
		<script type="text/javascript">
		<!--
		function submitpages(value){
			if(value==0){
				alert("请重新选择页码!");
				return ;
			}
			//alert(value);
			window.location.href='<%=basePath %>tjsinfo/tjsoa/reminded/remindedList.do?page='+value;			
		}
		//-->
		</script>
		<script>
var  highlightcolor='#d5f4fe';
//此处clickcolor只能用win系统颜色代码才能成功,如果用#xxxxxx的代码就不行,还没搞清楚为什么:(
var  clickcolor='#51b2f6';
function  changeto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=highlightcolor&&source.id!="nc"&&cs[1].style.backgroundColor!=clickcolor)
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=highlightcolor;
}
}

function  changeback(){
if  (event.fromElement.contains(event.toElement)||source.contains(event.toElement)||source.id=="nc")
return
if  (event.toElement!=source&&cs[1].style.backgroundColor!=clickcolor)
//source.style.backgroundColor=originalcolor
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}

function  clickto(){
source=event.srcElement;
if  (source.tagName=="TR"||source.tagName=="TABLE")
return;
while(source.tagName!="TD")
source=source.parentElement;
source=source.parentElement;
cs  =  source.children;
//alert(cs.length);
if  (cs[1].style.backgroundColor!=clickcolor&&source.id!="nc")
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor=clickcolor;
}
else
for(i=0;i<cs.length;i++){
	cs[i].style.backgroundColor="";
}
}
</script>
	</head>

	<body>
		<div id="tab_01" style="height:380px;">
			<div id="index_title">
		    	<ul>
			    	<li id="ul_title1" class="over"><a style="cursor:hand;font-size:14px;"><span>发出的提醒</span></a></li>
				</ul>
		    	<ul>
			    	<li><a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedSendList.do" style="cursor:hand;font-size:14px;"><span>收到的提醒</span></a></li>
				</ul>
			</div>
<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
	<td><table width="100%" border="0" style="font-size:14px;" cellpadding="0" cellspacing="1" bgcolor="#a8c7ce" onmouseover="changeto()"  onmouseout="changeback()">
      <tr>
        <td width="2%" height="25" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">ID</span></div></td>
        <td width="8%" height="25" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">提交时间</span></div></td>
        <td width="15%" height="25" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">题目</span></div></td>
        <td width="5%" height="25" bgcolor="d3eaef" class="STYLE6"><div align="center"><span class="STYLE10">基本操作</span></div></td>
      </tr>
					<%
					if (intPageCount > 0) {
						//将记录指针定位到待显示页的第一条记录上 
						int i=((intPage - 1) * intPageSize );
						for(int j=0;j<intPageSize && i<intRowCount;j++,i++){
							TSystemReminded tac = list.get(i);
					%>
					<tr id="<%=i%>">
						<td <%if(j%2==0)out.println("bgcolor='#F4F4F4'"); %> height="20" bgcolor="#FFFFFF" class="STYLE19">
							<%=j+1 %>
						</td>
						<td <%if(j%2==0)out.println("bgcolor='#F4F4F4'"); %> height="20" bgcolor="#FFFFFF" class="STYLE19">&nbsp;
							<%
							String time=DayFormat.getFormatDate(tac.getCreateDate(),DayFormat.Format24Datetime1);
							out.println(time);
							%>
						</td>
						<td <%if(j%2==0)out.println("bgcolor='#F4F4F4'"); %> height="20" bgcolor="#FFFFFF" class="STYLE19">
							<%
								String title=tac.getTitle();
								if(null != title){
								title=ds.substring(title,32);
								}else{title=null;}
								out.println(title);
					        %>
						</td>
						<td <%if(j%2==0)out.println("bgcolor='#F4F4F4'"); %> height="20" bgcolor="#FFFFFF">
						<div align="center" class="STYLE21">
							<a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedView.do?id=<%=tac.getId() %>&tag=me">查看</a>
						</div>
						</td>
					</tr>
					<%}}%>
</table></td>
</tr>	
<tr>
    <td height="30"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="33%"><div align="left"><span class="STYLE22">&nbsp;&nbsp;&nbsp;&nbsp;
        共有<strong> <%=list.size() %></strong> 条记录，当前第<strong> <%=intPage %></strong> 页，共 <strong><%=intPageCount %></strong> 页</span></div></td>
        <td width="57%"><table width="312" border="0" align="center" cellpadding="0" cellspacing="0">
          <tr>
            <td width="49"><div align="center">
            <%if(intPage==1) {%><a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedList.do?page=<%=intPage %>">
            <img src="<%=basePath %>reminded/images/main_54.gif" width="40" height="15" /></a> <%} %></div></td>
            <td width="49"><div align="center">
            <%if(intPage>=2) {%><a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedList.do?page=<%=intPage - 1%>">
            <img src="<%=basePath %>reminded/images/main_56.gif" width="45" height="15" /></a> <%} %></div></td>
            <td width="49"><div align="center">
            <%if(intPage<intPageCount) {%><a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedList.do?page=<%=intPage + 1%>">
            <img src="<%=basePath %>reminded/images/main_58.gif" width="45" height="15" /></a><%} %></div></td>
            <td width="49"><div align="center">
            <%if(intPage==intPageCount) {%><a href="<%=basePath %>tjsinfo/tjsoa/reminded/remindedList.do?page=<%=intPageCount%>">
            <img src="<%=basePath %>reminded/images/main_60.gif" width="40" height="15" /></a><%} %></div></td>
            <td width="37" class="STYLE22">
            <select name="select8" onChange="submitpages(this.value)">
	        		      <option value="0" height="10">--跳转--</option>
	        		      <%
	        		      	for(int pi=1;pi<=intPageCount;pi++){
	        		      %>
	        		      	<option value="<%=pi%>"><%=pi%></option>
	        		      <%} %>
	        </select>
            </td>
          </tr>
        </table></td>
        <td width="10%"><div align="left"><span class="STYLE22">
        <a href="<%=basePath %>reminded/remindedForm.jsp"><img src="<%=basePath %>reminded/images/main_52.gif" width="40" height="15" /></a></div></td>
      </tr>
    </table></td>
  </tr>
</table>

</div>
</body>
</html>